Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use more quotations in TH module #124

Merged
merged 1 commit into from
Nov 26, 2024
Merged

Use more quotations in TH module #124

merged 1 commit into from
Nov 26, 2024

Conversation

DigitalBrains1
Copy link
Member

We can use more quotations and less "bare" TH constructions.

This was intended as a change to #117, but it was already merged.

@lmbollen
Copy link
Member

I ah I see that your code too gets the unused pattern binding warning in TH.... I had them too and a a small rewrite fixed it for me, but I don't know when that triggers...

A seemingly bogus warning in GHC < 9.6 forces us to write some patterns
oddly to silence the warning.

For instance, instead of writing

    [d|
      Circuit $(varP ...) = ...
      |]

we're forced to write

    [d|
      $[p| Circuit $(varP ...) |] = ...
      |]

where we wrap a pattern P as $[p| P |] .
@DigitalBrains1
Copy link
Member Author

Yes, and the minimal fix is really silly. Instead of writing

[d|
  Circuit $(varP ...) = ...
  |]

we wrap it as

[d|
  $[p| Circuit $(varP ...) |] = ...
  |]

where we wrap a pattern P as $[p| P |] .

@lmbollen lmbollen merged commit 707d54b into main Nov 26, 2024
8 checks passed
@lmbollen lmbollen deleted the improve-th branch November 26, 2024 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants